<%@ page import="control.ControlVar" %>
<%@ page import="com.opensymphony.xwork2.util.ValueStack" %>
<%@ page import="control.ControlSettingInfo" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
  ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");
  ControlSettingInfo setting = (ControlSettingInfo) vs.findValue("settingInfo");
%>
<form action="setControlSetting.action" target="execute" method="post">
<dl class="admin-content-control-setting" id="controlSetting">
	<dt>请选择显示类型</dt>
	<dd>
	<input onclick="toggleRadio(this)" type="radio" <%=setting.getIpStart()==null?"checked":""%> name="settingInfo.type" value="<%=ControlVar.SETTING_TYPE_SUM%>" id="ctype1" />
    <label for="ctype1">按机器数量</label>
	<span style='display:<%=setting.getIpStart()!=null?"none":"inline"%>'>显示<input type="text"  name="settingInfo.computerSum" value="<s:property value="settingInfo.computerSum"/>" class="normal" style="margin-right:3px; width:30px; margin-bottom:-3px" />台</span>
	 </dd>
	 <dd><input onclick="toggleRadio(this)" type="radio" <%=setting.getIpStart()!=null?"checked":""%> name="settingInfo.type" value="<%=ControlVar.SETTING_TYPE_IP%>" id="ctype2" />
     <label for="ctype2">按IP地址范围</label>
	 <span style='display:<%=setting.getIpStart()!=null?"inline":"none"%>' >
     从<input type="text" name="settingInfo.ipStart" value="<s:property value="settingInfo.ipStart"/>" class="normal" style="margin-right:3px; width:80px;margin-bottom:-3px" />
     到<input type="text" name="settingInfo.ipEnd" value="<s:property value="settingInfo.ipEnd"/>" class="normal" style="margin-bottom:-3px;margin-right:3px; width:80px" /></span>
	 </dd>
	<dd>
	<button type="submit" class="blue"><span></span>确定</button>
	<button type="button" class="blue" onclick="kswindow.close()"><span></span>取消</button>
	</dd>
</dl>
</form>
<script>
	function toggleRadio(obj){
		$("#controlSetting dd>span").hide()
		$(obj).parent().find("span").show()
	}
</script>